<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<style>
    .upload {
        position: relative;
    }

    .upImg {
        width: 100px;
        height: 100px;
    }

    .upImg:hover {
        cursor: pointer;
    }

    .closeUpload {
        width: 20px;
        height: 20px;
        position: absolute;
        top: 0;
        right: 0;
    }

    .myupdataList {
        display: flex;
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .mybutton {
        background: #fff;
        height: 200px;
        width: 150px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        color: #a9b7b7;
        border: 2px solid #a9b7b7;
        margin-right: 10px;
        padding: 10px;
    }

    .mybutton:hover {
        cursor: pointer;
    }

    .layui-form-label {
        width: 115px !important;
    }

    .layui-input-block {
        display: flex;
        width: calc(100% - 115px);
        align-items: center;
    }

    .layui-input-block1 {
        display: flex;
        width: 333px;
        flex-direction: column;
        margin-left: 130px;

    }

    #contractState, #mySelect1, #mySelect2, .layui-form-select {
        width: 100%;
    }

    .layui-input {
        color: #000 !important;
    }
    a{
        margin: 0 10px;
    }
    .transformRoat{
        transform: rotate(45deg);
        margin: 0 10px;
    }
    .fa{
        cursor: pointer;
    }
    .myInputs{

        width: 333px!important;
    }
</style>

<body>

<input type="hidden" th:value="${type}" id="type"/>
<input type="hidden" th:value="${id}" id="dataId"/>
<input type="hidden" th:value="${myData}" id="myData"/>

<div class="layui-fluid mt2">
    <form class="layui-form" style="height: 100%" >

        <div class="layui-form-item">
            <label class="layui-form-label required">小区名称</label>
            <div class="layui-input-block1">
<!--                <input type="text" name="title" lay-verify="required" autocomplete="off"-->
<!--                       placeholder="请输入小区名称"-->
<!--                       id="title"-->
<!--                       th:value="${myData?.name}"-->
<!--                       class="layui-input">-->

<!--                <div class="layui-input-group">-->
                    <input type="text" id="title0" th:disabled="${type=='edit'&&myData?.status!=0}" class="layui-input" th:value="${myData?.name}" placeholder="请输入小区名称进行查询，右边选择">
<!--                    <div class="layui-input-split layui-input-suffix" style="cursor: pointer;" id="inputButton">-->
<!--                        <i class="layui-icon layui-icon-search"></i>-->
<!--                    </div>-->
<!--                </div>-->

                <select lay-affix="clear" lay-search=""
                        name="title" id="title" lay-verify="required"  th:disabled="${type=='edit'&&myData?.status!=0}"
                        th:attr="myValue=${myData?.name},myLon=${myData?.lon},myLat=${myData?.lat}">
                    <option value="">请等待数据加载</option>
                </select>

            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">楼栋房号</label>
            <div class="layui-input-block">
                <input type="text" name="title1" lay-verify="required" autocomplete="off"
                       placeholder="请输入楼栋房号"
                       id="title1"  th:disabled="${type=='edit'&&myData?.status!=0}"
                       th:value="${myData?.buildNumber}"
                       class="layui-input myInputs">
            </div>
        </div>

        <div class="layui-form-item">
            <th:block  th:if="${null!=oldList}">
                    <div class="layui-form-item">
                        <label class="layui-form-label">已入住床号</label>
                        <div class="layui-input-block" th:text="${oldList}" style="color: red">
                        </div>
                    </div>
            </th:block>
            <div class="layui-form-item">
            <label class="layui-form-label required">床号</label>
            <div class="layui-input-block" th:if="${type=='add'}">
                <input type="number" name="title2" lay-verify="required" autocomplete="off"
                       placeholder="请输入床号"
                       value="1"
                       class="layui-input myInputs">
                <i class="fa fa-close transformRoat" onclick="myI(0,this)"> </i>
            </div>
                <th:block th:if="${type!='add'}">
                   <div class="layui-input-block">
                    <input type="number" name="title2" lay-verify="required" autocomplete="off"
                           placeholder="请输入床号"
                           th:value="${doList.size()>0?doList[0].code:''}"
                           class="layui-input myInputs">
                    <i class="fa fa-close transformRoat" onclick="myI(0,this)"> </i>
                   </div>
                    <th:block  th:each="item,index : ${doList}">
                        <th:block th:if="${index.index!=0}">
                                                <div class="layui-form-item">
                                                    <label class="layui-form-label required">床号</label>
                                                    <div class="layui-input-block">
                                                        <input type="number" name="title2" lay-verify="required" autocomplete="off"
                                                               placeholder="请输入床号"
                                                               th:value="${item.code}"
                                                               class="layui-input myInputs">
                                                        <i class="fa fa-close" style="margin: 0 10px;" onclick="myI(1,this)"> </i>
                                                    </div>
                                                </div>
                        </th:block>
                    </th:block>




                </th:block>
            </div>
        </div>
        <div class="layui-form-item" id="myMap" style="height: 300px;display: none">

        </div>
        <div class="layui-form-item  layui-flow-more">
            <div class="layui-inline">
                <button type="submit" class="layui-btn" lay-submit lay-filter="submit"
                        th:text="${type=='add'?'立即提交':'确定'}"></button>
            </div>
        </div>

    </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/js/webJs/jzweb/house/info.js"></script>

</body>
</html>
